/**
 * 
 */
package br.com.doclayer.fs;

import java.io.File;
import java.util.Date;

import br.com.doclayer.ObjectMetadata;

/**
 * @author helder
 * @author glauco
 * 
 */
public class ObjectFsImpl implements ObjectMetadata {

  @Override
  public String toString() {
    return "ObjectFsImpl [UUID=" + this.uuid + ", name=" + this.name
        + ", createdBy=" + this.createdBy + ", creationDate="
        + this.creationDate + ", lastModifiedBy=" + this.lastModifiedBy
        + ", lastModificationDate=" + this.lastModificationDate + "]";
  }

  private String uuid;
  private String name;
  private String createdBy;
  private Date creationDate;
  private String lastModifiedBy;
  private Date lastModificationDate;

  public ObjectFsImpl(File file, String uuid) {
    if (!file.exists()) {
      throw new IllegalArgumentException("O objeto informado não existe.");
    }
    this.uuid = uuid;
    this.name = file.getName();
    // this.createdBy = object.getCreatedBy();
    this.creationDate = new Date(file.lastModified());
    // this.lastModifiedBy = object.getLastModifiedBy();
    this.lastModificationDate = new Date(file.lastModified());
  }

  @Override
  public String getUuid() {
    return this.uuid;
  }

  @Override
  public String getName() {
    return this.name;
  }

  @Override
  public String getCreatedBy() {
    return this.createdBy;
  }

  @Override
  public Date getCreationDate() {
    return this.creationDate;
  }

  @Override
  public String getLastModifiedBy() {
    return this.lastModifiedBy;
  }

  @Override
  public Date getLastModificationDate() {
    return this.lastModificationDate;
  }

}
